﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace EulerLib
{
    public class Point
    {
        public int X { set; get; }
        public int Y { set; get; }

        public List<Point> GetPointsInDirection(Direction direction, int distance)
        {
            List<Point> points = new List<Point>(distance);

            Point currentPoint = new Point() { X = this.X, Y = this.Y };

            for (int i = 0; i < distance; i++)
            {
                switch (direction)
                {
                    case Direction.East:
                        currentPoint.X++;
                        break;
                    case Direction.West:
                        currentPoint.X--;
                        break;
                    case Direction.South:
                        currentPoint.Y++;
                        break;
                    case Direction.North:
                        currentPoint.Y--;
                        break;
                    case Direction.NorthEast:
                        currentPoint.Y--;
                        currentPoint.X++;
                        break;
                    case Direction.NorthWest:
                        currentPoint.Y--;
                        currentPoint.X--;
                        break;
                    case Direction.SouthEast:
                        currentPoint.Y++;
                        currentPoint.X++;
                        break;
                    case Direction.SouthWest:
                        currentPoint.Y++;
                        currentPoint.X--;
                        break;
                }

                points.Add(new Point() { X = currentPoint.X, Y = currentPoint.Y });
            }

            return points;
        }
    }
}
